package com.lottemall.item.api;

import com.lottemall.item.pojo.SpecGroup;
import com.lottemall.item.pojo.SpecParam;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 规格参数Api
 */
public interface SpecificationApi {
    /**
     * 查询规格参数的集合
     * 是动态的
     * @param gid 规格组gid
     * @param cid 商品类型cid
     * @param searching 是否搜索
     * @return
     */
    @RequestMapping("spec/params")
    List<SpecParam> queryParamByList(
            @RequestParam(value = "gid", required = false) Long gid,
            @RequestParam(value = "cid", required = false) Long cid,
            @RequestParam(value = "searching", required = false) Boolean searching
    );

    /**
     * 根据商品分类id查询规格组
     * @param cid
     * @return
     */
    @GetMapping("spec/group")
    List<SpecGroup> queryGroupByCid(@RequestParam("cid") Long cid);

}
